package servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class LoginOutServlet extends HttpServlet{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8538076142868886263L;
	
	public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
		Cookie uid = new Cookie("uid",null);
		Cookie password = new Cookie("password",null);
		uid.setMaxAge(0);
		password.setMaxAge(0);
		request.getSession().invalidate(); 
		response.addCookie(uid);
		response.addCookie(password);
		//跳转
		/*RequestDispatcher dispatcher = request.getRequestDispatcher("public/login.jsp");
		dispatcher.forward(request, response) ;*/
		response.sendRedirect("/bookcrossing/");
	}
}
